#ifndef SERVER_H
#define SERVER_H

#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include <vector>
#include <queue>
#include <iostream>
#include <QStack>

class Server : public QObject
{
    Q_OBJECT
public:
    explicit Server(QObject *parent = 0, quint16 uport = 8888);
private:
    QTcpServer *server;
    QSet<QTcpSocket*> clients;
    QSet<QString> users;
    QMap<QTcpSocket*,QString> userMap;
signals:

public slots:
    void acceptConnection();
    void readClient();
    void recvDiscon();
public:
    void sendAll(QString inf);
    void sendPrivate(QString target,QString inf);
};

#endif // SERVER_H
